/*
EP3D is a real-time 3D planet engine , which in addition to providing 
substandard scene rendering and scene management, of course, it also 
provides some basic class libraries to build the entire virtual 
planet, or even the entire universe.

Copyright (C) 2010  Hongjiang Zhang	(zhjwyat@gmail.com)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef EP3D_QUADTREESCENEMANAGER_H
#define EP3D_QUADTREESCENEMANAGER_H
#include "EP3DSceneManager.h"
#include "EP3DBoundingBox.h"
#include "EP3DVideoDriver.h"
#include "EP3DSceneNode.h"
#include "EP3DList.h"

namespace EP3D
{
	class QuadTreeNode;
	typedef List<QuadTreeNode*> QuadTreeNodeList;
	class EP3DEXPORT QuadTreeSceneManager
		:public SceneManager
	{
	public:
		QuadTreeSceneManager(void);
		virtual ~QuadTreeSceneManager(void);

		void Init(const BBox3f& box, uint uiDepth);

		virtual const BBox3f& GetBoundingBox() const;
		virtual uint GetDepth() const;

		virtual bool AddQuadSceneNode(SceneNode* pkParent, char nLevel, uint uiCol, uint uiRow);
		virtual void DeleteQuadSceneNode(QuadTreeNode* pkNode); 

	protected:
		friend class QuadTreeNode;

		uint m_uiTreeDepth;
		BBox3f m_kBBox;
		Vector3f m_vBaseNodeSize;

		QuadTreeNodeList m_kNodes;


	};
}
#endif


